package com.aaa.maintain.controller.api;

import com.aaa.maintain.service.MainRecordService;
import com.aaa.security.annotation.MyLog;
import com.aaa.vo.MainRecordVo;
import com.aaa.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 维修记录
 * @author 荆豪峰
 * @version 1.0
 * #Date: 2023/3/1 13:51
 */
@Api(value = "main/record", tags = {"维修记录 #Date: 2023/3/1 13:51"})
@RestController
@RequestMapping("main/record")
public class MainRecordController {
    @Autowired
    private MainRecordService mainRecordService;
    /**
     * #Description 维修记录查询
     * @param currentPage
     * @param pageSize
     * @param mainRecordVo
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/1
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "currentPage", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "pageSize", value = "", required = true),
            @ApiImplicitParam(paramType = "body", dataType = "MainRecordVo", name = "mainRecordVo", value = "", required = true)
    })
    @ApiOperation(value = "#Description 维修记录查询 #Date 2023/3/1", notes = "#Description 维修记录查询 #Date 2023/3/1", httpMethod = "POST")
    @MyLog(title="查询维修记录")
    @PostMapping("list")
    public Result list(Integer currentPage, Integer pageSize, @RequestBody MainRecordVo mainRecordVo){
        return mainRecordService.list(currentPage,pageSize,mainRecordVo);
    }
    /**
     * #Description 维修记录删除
     * @param id
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/1
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "id", value = "", required = true)
    })
    @ApiOperation(value = "#Description 维修记录删除 #Date 2023/3/1", notes = "#Description 维修记录删除 #Date 2023/3/1", httpMethod = "DELETE")
    @MyLog(title="删除维修记录")
    @DeleteMapping("delete")
    public Result delete(Integer id){
        return mainRecordService.delete(id);
    }

}
